﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ecreate.Model;
using Ecreate.Business;
namespace Ecreate.Web.systemanage.product
{
    public partial class productlist : System.Web.UI.Page
    {
        private string _StringQuery = string.Empty;

        public string StringQuery
        {
            get { return _StringQuery; }
            set { _StringQuery = value; }
        }


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string classid = this.Request.QueryString["classid"];
                this.hid_classid.Value = classid;
                if (!String.IsNullOrEmpty(classid))
                {
                    ProductService service = new ProductService();
                    Product model = new Product();
                    model.Classid = classid;
                    ArrayList list = service.getProductByClassID(model);
                    this.GridView1.DataSource = list;
                    this.GridView1.DataBind();
                }
            }
        }

        protected String getStringValue(Object o)
        {
            if (o == null)
                return "";
            else
                return o.ToString().Trim();
        }

        protected void GridView1_PageIndexChanged(object sender, EventArgs e)
        {

        }

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {

            string classid = this.Request.Form["hid_classid"];
            if (!String.IsNullOrEmpty(classid))
            {
                this.GridView1.PageIndex = e.NewPageIndex;
                ProductService service = new ProductService();
                Product model = new Product();
                model.Classid = classid;
                ArrayList list = service.getProductByClassID(model);
                this.GridView1.DataSource = list;
                this.GridView1.DataBind();
            }

        }
    }
}
